<?

//引入所有子系统信息
include_once("../../../common/model/extender_import.php");
//引入系统设置
include_once("../../../common/model/setting.php");




//这个start date是搜索框条件的start 和 数据库的项没有直接关系。
if($_REQUEST['select_startday'])
{
    $start_date=$_REQUEST['select_startday']." 00:00:00";
    $start_date_str=" and paydate > '".$start_date."'";
}
else
{
    $start_date_str=" and paydate > '".date("Y-m")."-01  00:00:00 '";
}




if($_REQUEST['select_endday'])
{
    $end_date=$_REQUEST['select_endday']." 23:59:59";
    $end_date_str=" and paydate < '".$end_date."'";
}
else
{
    $end_date_str=" and paydate < '".date("Y-m-d h:i:s")."'";
}




//怎么定义已经完成的任务？paydate的日期为准
$condition_done="nid > 0 ".$start_date_str.$end_date_str;


//设置需要搜索的表格的前缀后缀
$table_suffix = "case";
$table = $table_Prefix . $table_suffix;


$case_done_list=select_lines_all_items($table,"nid desc",$condition_done,"");







//计算进行中的项目
//这个start date是搜索框条件的start 和 数据库的项没有直接关系。
if($_REQUEST['select_startday'])
{
    $start_date=$_REQUEST['select_startday']." 00:00:00";
    $start_date_str=" and startdate > '".$start_date."'";
}
else
{
    $start_date_str=" and startdate > '".date("Y-m")."-01  00:00:00 '";
}




if($_REQUEST['select_endday'])
{
    $end_date=$_REQUEST['select_endday']." 23:59:59";
    $end_date_str=" and startdate < '".$end_date."'";
}
else
{
    $end_date_str=" and startdate < '".date("Y-m-d h:i:s")."'";
}


//怎么定义接单任务？用开始项目的日子计算
$condition_start="nid >0 and (status like '%完成%' or status like '%进行中%') ".$start_date_str.$end_date_str;


//设置需要搜索的表格的前缀后缀
$table_suffix = $plate['table_Suffix'];
$table = $table_Prefix . $table_suffix;




$case_start_list=select_lines_all_items($table,"nid desc",$condition_start,"");




$start_date_str=" and startdate like '%".date("Y")."%'";
$end_date_str  =" and paydate like '%".date("Y")."%'";


$condition_year_start="nid > 0  and (status like '%完成%' or status like '%进行中%')  ".$start_date_str;
$condition_year_done ="nid > 0 ".$end_date_str;


//本年度开展的项目和本年度完成的项目
$case_year_start_list=select_lines_all_items($table,"nid desc",$condition_year_start,"");
$case_year_done_list=select_lines_all_items($table,"nid desc",$condition_year_done,"");




?>












